<?php

namespace app\admin\model;

use think\Model;
use think\model\concern\SoftDelete;

class User extends Model
{

    use SoftDelete;
    protected $deleteTime = 'delete_time';

    public function getUserStatusAttr($value)
    {
        $status = [1=>'启用',0=>'停用'];
        return $status[$value];
    }
    public function role()
    {
        return $this->belongsTo('role','role_id','id');
    }
}
